/**
 * 
 */
package com.ar.myshares.security.social;

import javax.inject.Inject;

import org.springframework.dao.DataAccessException;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.social.security.SocialUserDetails;
import org.springframework.social.security.SocialUserDetailsService;

import com.ar.myshares.services.UserService;

/**
 * @author hernan.gastaud
 *
 */
public class SimpleSocialUserDetailsService implements SocialUserDetailsService {

	@Inject
	private UserService userDetailsService;

	@Override
	public SocialUserDetails loadUserByUserId(String userId) throws UsernameNotFoundException, DataAccessException {
		UserDetails userDetails = userDetailsService.loadUserByUsername(userId);
		return (SocialUserDetails) userDetails;
	}
}
